var spritesmith = require("gulp-spritesmith");
var gulpif = require("gulp-if");
var gulp = require("gulp");
var base64 = require('./gulp-base64');
// var  tasks =require("tasks");
gulp.task('sprites', function () {
    return  gulp.src('./img/*.png')
        .pipe(spritesmith({
            imgName: 'img/sprite.png',
            styleName: 'sprite.css',
            imgPath: '../img/Sprite/sprite.png'
        }))
        .pipe(gulpif('*.png', gulp.dest('./dist/img/')))
        .pipe(gulpif('*.css', gulp.dest('./dist/css/')))
    .pipe(gulp.src('./dist/img/img/Sprite.png'))
        .pipe(base64())
        .pipe(concat('main.css'))
        .pipe(gulp.dest('./public/css'));
});


//basic example
gulp.task('build', function () {
    return gulp.src('./dist/img/img/Sprite.png')
        .pipe(base64())
        .pipe(concat('main.css'))
        .pipe(gulp.dest('./public/css'));
});